import { exInput, exRadioGroup, exSwitch, exSelectAllowCreate } from '@ve/common/components/extension'
import { exInputNumber } from '../../extension/index'
export default {
  VERSION: '20220624',
  type: 'uiGaugeChart',
  name: '仪表盘',
  icon: 'dashboard-3-line',
  //扩展
  extension: {
    requestSet: {
      type: 'exRequestSet',
      name: '接口配置',
      value: {
        api: '/wms/wms-web',
        method: 'wms.screen.query.test',
        getDataKey: 'wms.screen.query.test',
        loopRequest: false,
        loopTime: 3000,
        nameKey: '',
        valueKey: '',
        busList: [],
        dataObj: {},
        isJson: false,
        data: [
          { key: '#LIMIT#', value: '1' },
          { key: '#PAGE_SIZE#', value: '10' },
        ],
        resList: [],
      },
    },
    title_show: exSwitch('是否显示标题', true),
    title_text: exInput('图表标题', '标题'),
    title_left: exSelectAllowCreate(
      '标题横向位置',
      'center',
      [
        {
          value: 'left',
          label: '左',
        },
        {
          value: 'center',
          label: '中',
        },
        {
          value: 'right',
          label: '右',
        },
      ],
      '标题横向位置,可自定义'
    ),
    title_top: exSelectAllowCreate(
      '标题纵向位置',
      'top',
      [
        {
          value: 'top',
          label: '上',
        },
        {
          value: 'middle',
          label: '中',
        },
        {
          value: 'bottom',
          label: '下',
        },
      ],
      '标题纵向位置,可自定义'
    ),
    tooltip: {
      type: 'exSwitchToolTip',
      name: '配置提示框',
      value: {
        show: true,
        trigger: 'item',
        triggerOn: 'mousemove',
        showDelay: 0,
        hideDelay: 100,
        backgroundColor: '#fff',
        borderColor: '#fff',
        borderWidth: 0,
        padding: 5,
        textStyle: {
          color: '#888',
          fontSize: 14,
          fontWeight: 'normal',
        },
        formatter: '{a}:<br>{b}:{c}',
      },
    },
    legend_show: exSwitch('显示图例', true),
    legend_orient: exRadioGroup('图例组件方向', 'vertical', [
      {
        value: 'horizontal',
        label: '横',
      },
      {
        value: 'vertical',
        label: '竖',
      },
    ]),
    legend_type: exRadioGroup('图例展示类型', 'scroll', [
      {
        value: 'scroll',
        label: '分页',
      },
      {
        value: 'plain',
        label: '全部展示',
      },
    ]),
    legend_left: exSelectAllowCreate(
      '图例组件横向位置',
      'left',
      [
        {
          value: 'left',
          label: '左',
        },
        {
          value: 'center',
          label: '中',
        },
        {
          value: 'right',
          label: '右',
        },
      ],
      '图例组件横向位置，可自定义'
    ),
    legend_top: exSelectAllowCreate(
      '图例组件纵向位置',
      'top',
      [
        {
          value: 'top',
          label: '上',
        },
        {
          value: 'middle',
          label: '中',
        },
        {
          value: 'bottom',
          label: '下',
        },
      ],
      '图例组件纵向位置,可自定义'
    ),
    legend_icon: exSelectAllowCreate(
      '图例图形',
      'rect',
      [
        {
          value: 'rect',
          label: '方形',
        },
        {
          value: 'circle',
          label: '圆形',
        },
        {
          value: 'roundRect',
          label: '圆角方形',
        },
        {
          value: 'triangle',
          label: '三角形',
        },
        {
          value: 'diamond',
          label: '菱形',
        },
        {
          value: 'pin',
          label: '大头针',
        },
        {
          value: 'arrow',
          label: '箭头',
        },
      ],
      '可自定义,格式image://图片链接'
    ),
    legend_formatter: exInput('格式化数据', ''),
    legend_itemWidth: exInputNumber('图例图形宽', 10, 1, 100),
    legend_itemHeight: exInputNumber('图例图形高', 10, 1, 100),
    legend_textStyle_fontSize: {
      type: 'exInputNumber',
      name: '字体大小',
      value: 12,
    },
    series: {
      type: 'exChartSeries',
      name: '图表配置',
      id: 'gauge',
      value: [
        {
          type: 'gauge',
          name: '仪表盘',
          colorBy: 'data',
          center: ['50%', '50%'],
          radius: '75%',
          legendHoverLink: true,
          startAngle: 225,
          endAngle: -45,
          clockwise: true,
          min: 0,
          max: 100,
          splitNumber: 10,
          axisLine: {
            show: true,
            roundCap: false,
            lineStyle: {
              color: [
                [0.1, 'red'],
                [0.5, 'blue'],
                [1, 'yellow'],
              ],
              width: 10,
              shadowBlur: 0,
              shadowColor: '#000',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          progress: {
            show: false,
            overlap: true,
            width: 10,
            roundCap: false,
            clip: false,
            itemStyle: {
              color: '#000',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderCap: 'butt',
              shadowBlur: 0,
              shadowColor: '#000',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          splitLine: {
            show: true,
            length: 10,
            distance: 10,
            lineStyle: {
              color: '#000',
              width: 3,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              shadowBlur: 0,
              shadowColor: '#000',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          axisTick: {
            show: true,
            length: 10,
            splitNumber: 5,
            distance: 10,
            lineStyle: {
              color: '#000',
              width: 3,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              shadowBlur: 0,
              shadowColor: '#000',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          axisLabel: {
            show: true,
            distance: 15,
            color: '#000',
            fontWeight: 500,
            fontSize: 12,
            backgroundColor: 'transparent',
            borderColor: 'transparent',
            borderWidth: 2,
            borderType: 'solid',
            borderDashOffset: 0,
            borderRadius: 0,
            padding: [0, 0, 0, 0],
            shadowColor: 'transparent',
            shadowBlur: 0,
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            width: 100,
            height: 40,
            textBorderColor: 'transparent',
            extBorderWidth: 0,
            textBorderType: 'solid',
            textBorderDashOffset: 0,
            textShadowColor: 'transparent',
            textShadowBlur: 0,
            textShadowOffsetX: 0,
            textShadowOffsetY: 0,
            overflow: 'truncate',
            ellipsis: '...',
          },
          pointer: {
            show: true,
            showAbove: true,
            icon: 'arrow',
            offsetCenter: [0, 0],
            length: '60%',
            width: 6,
            itemStyle: {
              color: '#000',
              borderColor: 'transparent',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderCap: 'butt',
              shadowBlur: 0,
              shadowColor: '#000',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          anchor: {
            show: true,
            showAbove: false,
            size: 6,
            icon: 'none',
            offsetCenter: [0, 0],
            keepAspect: false,
            itemStyle: {
              color: '#FFF',
              borderColor: '#5470c6',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderCap: 'butt',
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          itemStyle: {
            color: '#000',
            borderColor: '#000',
            borderWidth: 0,
            borderType: 'solid',
            borderDashOffset: 0,
            borderCap: 'butt',
            shadowBlur: 10,
            shadowColor: 'transparent',
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            opacity: 1,
          },
          emphasis: {
            disabled: false,
            itemStyle: {
              color: 'auto',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderCap: 'butt',
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          detail: {
            show: true,
            color: '#464646',
            backgroundColor: 'transparent',
            borderColor: '#000',
            borderWidth: 0,
            borderType: 'solid',
            borderDashOffset: 0,
            borderRadius: 0,
            padding: [0, 0, 0, 0],
            shadowBlur: 10,
            shadowColor: 'transparent',
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            width: 100,
            height: 40,
            textBorderColor: 'transparent',
            extBorderWidth: 0,
            textBorderType: 'solid',
            textBorderDashOffset: 0,
            textShadowColor: 'transparent',
            textShadowBlur: 0,
            textShadowOffsetX: 0,
            textShadowOffsetY: 0,
            overflow: 'truncate',
            ellipsis: '...',
            valueAnimation: true,
            offsetCenter: [0, '40%'],
          },
          markPoint: {
            symbol: 'pin',
            symbolSize: 50,
            symbolRotate: 0,
            symbolKeepAspect: false,
            symbolOffset: [0, 0],
            silent: false,
            label: {
              show: true,
              position: 'inside',
              rotate: 0,
              offset: [0, 0],
              color: '#fff',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
              formatter: '{b}',
            },
          },
          markLine: {
            symbol: 'pin',
            symbolSize: 50,
            precision: 2,
            silent: false,
            label: {
              show: true,
              position: 'end',
              color: '#fff',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
              formatter: '{b}',
            },
          },
          markArea: {
            silent: false,
            label: {
              show: true,
              position: 'end',
              rotate: 0,
              offset: [0, 0],
              color: '#fff',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
              formatter: '{b}',
            },
            itemStyle: {
              color: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderCap: 'butt',
              borderDashOffset: 0,
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
            emphasis: {
              disabled: false,
              label: {
                show: true,
                position: 'end',
                color: '#fff',
                fontSize: 12,
                align: 'left',
                verticalAlign: 'top',
                backgroundColor: 'transparent',
                borderColor: '#000',
                borderWidth: 0,
                borderType: 'solid',
                borderDashOffset: 0,
                borderRadius: 0,
                padding: [0, 0, 0, 0],
                shadowBlur: 10,
                shadowColor: 'transparent',
                shadowOffsetX: 0,
                shadowOffsetY: 0,
                width: 100,
                height: 40,
                textBorderColor: 'transparent',
                extBorderWidth: 0,
                textBorderType: 'solid',
                textBorderDashOffset: 0,
                textShadowColor: 'transparent',
                textShadowBlur: 0,
                textShadowOffsetX: 0,
                textShadowOffsetY: 0,
                overflow: 'truncate',
                ellipsis: '...',
              },
              itemStyle: {
                color: 'transparent',
                borderColor: '#000',
                borderWidth: 0,
                borderType: 'solid',
                borderCap: 'butt',
                borderDashOffset: 0,
                shadowBlur: 10,
                shadowColor: 'transparent',
                shadowOffsetX: 0,
                shadowOffsetY: 0,
                opacity: 1,
              },
            },
            animation: true,
            animationThreshold: 2000,
            animationDuration: 1000,
            animationEasing: 'cubicOut',
            animationDelay: 0,
            animationDurationUpdate: 300,
            animationEasingUpdate: 'cubicInOut',
            animationDelayUpdate: 0,
          },
          silent: false,
          animation: true,
          animationThreshold: 2000,
          animationDuration: 1000,
          animationEasing: 'cubicOut',
          animationDelay: 0,
          animationDurationUpdate: 300,
          animationEasingUpdate: 'cubicInOut',
          animationDelayUpdate: 0,
          tooltip: {
            positionType: true,
            position: [0, 0],
            backgroundColor: 'rgba(50,50,50,0.7)',
            borderColor: '#333',
            borderWidth: 0,
            padding: [5, 5, 5, 5],
            textStyle: {
              color: '#fff',
              fontSize: 14,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
            },
          },
        },
      ],
    },
  },
  //交互
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
}
